import http from '@/http/index'
import type { SysMenu, SysUser } from '@/types'
import type { LoginParam, MenuParam, UserParam } from '@/types/param'

export const login = (params: LoginParam) => {
  return http.post('/store/login', params)
}
export const getUserInfo = () => {
  return http.get('/store/user/info')
}
export const getUserList = (params: UserParam) => {
  return http.post('/store/user/list', params)
}
export const addUser = (params: SysUser) => {
  return http.post('/store/user/add', params)
}
export const updateUser = (params: SysUser) => {
  return http.post('/store/user/update', params)
}
export const deleteUser = (params: number[]) => {
  return http.post('/store/user/delete', params)
}
export const getMenuList = (params: MenuParam) => {
  return http.post('/store/menu/list', params)
}
export const addMenu = (params: SysMenu) => {
  return http.post('/store/menu/add', params)
}
export const updateMenu = (params: SysMenu) => {
  return http.post('/store/menu/update', params)
}
export const deleteMenu = (params: number[]) => {
  return http.post('/store/menu/delete', params)
}
